package org.shop.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.shop.dao.UsersMapper;
import org.shop.entity.Goods;
import org.shop.entity.Users;
import org.shop.service.UserService;
import org.shop.service.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends BaseServiceImpl<Users, Long> implements UserService {
	@Autowired
    private UsersMapper usersMapper;
    
	@Override
	public List<Users> getUsersList() {
		
		return usersMapper.getUsersList();
	}

	@Override
	public Users findUserByLoginName(String LoginName) {
		
		return usersMapper.findUserByLoginName(LoginName);
	}

	@Override
	public Map<String, Object> getAllUsersInfoList(Map<String, Object> pramMap) {
		List<Map<String, Object>> allUsersInfoList = usersMapper.getAllUsersInfoList(pramMap);
        Integer count = usersMapper.getAllUsersInfoCount(pramMap);
        //分页数据
        Map<String, Object> dataMap = new HashMap<String, Object>();
        dataMap.put("total", count);
        dataMap.put("rows", allUsersInfoList);
        return dataMap;
	}

	@Override
	public Users findUserByStudentCode(String studentCode) {
		
		return usersMapper.findUserByStudentCode(studentCode);
	}

	@Override
	public Users getUserInfoByConditions(Map<String, Object> pramMap) {
		return usersMapper.getUserInfoByConditions(pramMap);
	}

	@Override
	public int addOpenIdByLoginName(Map<String, Object> pramMap) {
		return usersMapper.addOpenIdByLoginName(pramMap);
	}
	
}
